﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChallengePuzzle.Lib
{
    public class SquareSum
    {
        public int GetSquareSum(int Number)
        {
            int DivNum = Number / 10;

            int LessNum = Number % 10;

            if (DivNum < 10)
            {
                return DivNum * DivNum + LessNum * LessNum;
            }

            return GetSquareSum(DivNum) + LessNum * LessNum;
        }

    }
}
